This note describe how to configure, diagnose and debug hardware with itc board. some good reads:

* http://processors.wiki.ti.com/index.php/AM335x_PSP_User%27s_Guide

==boot==
* if unsuccessful get "CCCCC" from UART0, plz check hardware short circuit. (happened with itc 1st coreboard display resistors

===boot resistors===
*Nand boot
*SD boot

===Overclocking===
https://groups.google.com/forum/?fromgroups=#!topic/beagleboard/SiN_jhEw5gg

==eeprom==
http://azkeller.com/blog/?p=62

 cat data.eeprom >  /sys/bus/i2c/drivers/at24/1-0050/eeprom

==nand==
* enable pinmux
* guide: http://processors.wiki.ti.com/index.php/Writing_Kernel_Image_to_NAND_Flash
* guide2: http://elinux.org/BeagleBoardNAND
* guide3: http://bbs.eeworld.com.cn/thread-355960-1-1.html


===micron nand patching===
 http://lists.infradead.org/pipermail/linux-mtd/2010-July/031068.html
 http://patchwork.ozlabs.org/patch/216188/

====nand from ocz 120g ssd ====
 Micron MT29F64G08CBAAA3W


===mtd-utils ver===
by ti: http://git.infradead.org/mtd-utils.git/snapshot/d37fcc0afd0d4a14c56812847e8e4257d0a99e3b.tar.gz

or 1.4.8 official
ftp://ftp.infradead.org/pub/mtd-utils/mtd-utils-1.4.8.tar.bz2

===nand problems and fix===
* 4096 Page, 224 oob, resulting boot ROM unable to read NAND correctly -> add bch16 support in uboot
* 224 oob and linux mtd-utils to use 1.4.8
* uboot partition, edit u-boot include/configs/am335x....h
* kernel partition, edit kernel arch/arm/mach-omap2/board-am335x.c

*kernel drv: http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/716/t/233142.aspx


===nand timing tweaking===

<pre>

/*
 * Note that all values in this struct are in nanoseconds except sync_clk
 * (which is in picoseconds), while the register values are in gpmc_fck cycles.
 */
struct gpmc_timings {
  /* Minimum clock period for synchronous mode (in picoseconds) */
  u32 sync_clk;

  /* Chip-select signal timings corresponding to GPMC_CS_CONFIG2 */
  u16 cs_on;    /* Assertion time */
  u16 cs_rd_off;    /* Read deassertion time */
  u16 cs_wr_off;    /* Write deassertion time */

  /* ADV signal timings corresponding to GPMC_CONFIG3 */
  u16 adv_on;   /* Assertion time */
  u16 adv_rd_off;   /* Read deassertion time */
  u16 adv_wr_off;   /* Write deassertion time */

  /* WE signals timings corresponding to GPMC_CONFIG4 */
  u16 we_on;    /* WE assertion time */
  u16 we_off;   /* WE deassertion time */

  /* OE signals timings corresponding to GPMC_CONFIG4 */
  u16 oe_on;    /* OE assertion time */
  u16 oe_off;   /* OE deassertion time */

  /* Access time and cycle time timings corresponding to GPMC_CONFIG5 */
  u16 page_burst_access;  /* Multiple access word delay */
  u16 access;   /* Start-cycle to first data valid delay */
  u16 rd_cycle;   /* Total read cycle time */
  u16 wr_cycle;   /* Total write cycle time */

  /* The following are only on OMAP3430 */
  u16 wr_access;    /* WRACCESSTIME */
  u16 wr_data_mux_bus;  /* WRDATAONADMUXBUS */
};


</pre>

==ubifs==
http://blog.sina.com.cn/s/blog_5de7d9f80100dpa4.html

use mkfs.ubifs to create a ubifs.img, and use ubinize to create ubi.img and use nandwrite -p /dev/mtd7 /boot/uboot/ubi.img to write image to nand.


==ecc issue==

http://e2e.ti.com/support/arm/sitara_arm/f/791/t/208040.aspx


possible ecc patch (plz read):
http://permalink.gmane.org/gmane.comp.boot-loaders.u-boot/152251

==network cards ==
* check MII interface
* check pin_mux 
* in linux check /etc/networking/interface, use ''ifconfig -a'' to list all devices.

===CPSW===
This seems to support switch mode, basically CPU has 1 switch and 2 physical switches.

http://e2e.ti.com/support/arm/sitara_arm/f/791/t/194714.aspx

http://processors.wiki.ti.com/index.php/AM335x_CPSW_(Ethernet)_Driver's_Guide

Here is another guide to modes:
* [http://superuser.com/questions/552187/linux-configure-2-nics-to-team-mode-redundancy-mode-switch-mode 3 modes]
* [http://linux.die.net/man/8/ifenslave ifenslave]
* [http://wiki.lustre.org/manual/LustreManual20_HTML/SettingUpBonding.html bonding(how to)]
* [https://www.kernel.org/pub/linux/kernel/people/marcelo/linux-2.4/Documentation/networking/bonding.txt kernel bonding driver mini-how to]
* [https://secure.marumoto.us/motowiki/tiki-index.php?page=IfEnslave ifenslave simple usage]

==sound card==
* read wiring McASP0 or McASP1 connection
* modify kernel arch/arm/mach-omap2/board-am335xevm.c and sound/soc/davinci/davinci-evm.c
* modify McASP channel
* modify pinmux
* modify mcasp0_init

==PMIC==
power management integrated circuit:
* read datasheet 65910
* use I2C to control set registers

==screen==
* check blight
* check lcdc_init in kernel
* backlight by default off. (adjust PWM interval and default brightness)
* itc use this chip for backlight:  http://www.datasheetcatalog.org/datasheet2/6/0rg143py3uzto3p66fx5d1s08icy.pdf

==Touch Screen==

===adc pin rewire Touchscreen===
To use TI's software for touchscreen natively, we need to re-wire the board(2012-12-03) at 40pin section by following:

<pre>
37 -> ADC3
38 -> ADC1
39 -> ADC4
40 -> ADC2
</pre>


===i2c touchscreen capacitive ===

config INTERUPT pin and I2C address.

==RTC==
Sch 电路图中P6页中
Vin和U7之间加二极管和电阻、电池

=== command lines ===
Show system time:
 hwclock --show
Set hardware RTC time:
 hwclock --set --date="07/07/06 10:19"

==USB==
* set DIP (close to SD CARD slot) 7,8 to '''On'''
* check kernel usb0_init(), usb1_init()
* solder 0Ω resistor.
* check USB mode in kernel (OTG or HOST)

==Keyboard==
use matrix keypad

==ADC==
http://processors.wiki.ti.com/index.php/AM335x_ADC_Driver's_Guide

 cat /sys/bus/iio/devices/iio\:device0/in_voltage0_raw

=== '''Formula Used for Calculation ''' ===
D = Vin * (2^n - 1) / Vref Where: D = Digital value Vin = Input voltage n = No of bits Vref = reference voltage

==IrDA==
read: http://processors.wiki.ti.com/index.php/AM35x_To_AM335x_Hardware_Migration_Guide#UART

read raspberry pi: http://aron.ws/projects/lirc_rpi/

http://forum.stmlabs.com/showthread.php?tid=1954

we made a kernel hack from RPi to beaglebone.

to debug:
 cat /sys/kernel/debug/gpio
 cat /proc/interrupts 

to view outs:
 cat /dev/lirc0

===gpio positions===
*gpio0-20 as OUT on am335x
*gpio0-20 as IN on am335x

==GPIO==
* pinmux
* export direction and pull up/down
* linux poll

==I2C addresses==
Under ITC core board, only i2c-bus 1 is actively used. I2C communicates all the devices: Here are Known devices:

find out each device name by:
  cat /sys/devices/platform/omap/omap_i2c.1/i2c-1/1-002d/name

* 0x1b tlv320aic3x
* 0x2d tps65910
* 0x50 24c256
* 0x51 24c256

==wifi==
* build kernel modules and corresponding drivers.
* use command to scan `iwlist scan`
* bring up wifi by `ifconfig wlan0 up`
* setup auto start by `auto wlan0 ...`

==some refs==
http://blog.chinaunix.net/uid-28458801-id-3486399.html

==SPI==
TI guide: http://processors.wiki.ti.com/index.php/AM335x_McSPI_Driver's_Guide

beagle user app ref:http://communistcode.co.uk/blog/blogPost.php?blogPostID=1


===spi doc===
https://www.kernel.org/doc/Documentation/spi/spi-summary


===to enable in am335x===
# edit SPIDEV in menuconfig to enable
# add spi0_init
# add spi0_info into spi0 func.

==Power Current==

测试结果(以下均为没有插外设的稳态电流):
* ITC core rev B + PA-01201电路板稳定时总输入电流 305mA (在登录控制台时)(去掉背光电路)
* PA-01201底板的背光电路不完善,没有连接屏时电流300mA,接上屏之后90mA.
* 把ITC core rev B核心板的RAM电路中并行匹配的6个排阻去掉后电流能减小50mA左右,整版总电流在269mA.
* 以下是ITC core rev B核心板相关电流
{| width="350" cellspacing="1" cellpadding="1" border="1"
|+ CPU电流 
|-
| 名称 
| 电流 
| 位置 
| 电压
|-
| VDD_CORE 
| 140mA 
| FB7 
| 1.115V
|-
| VDD_MPU 
| 120mA
| FB6
| 1.121V
|-
| VDDS_DDR 
| 140mA
| FB8
| 1.523V
|}

{| width="350" cellspacing="1" cellpadding="1" border="1"
|+ 外设电流 
|-
| 名称 
| 电流 
| 位置 
|-
| VD33
| 60mA 
| U8 pin2 
|-
| 3106 
| 10mA
| FB11
|-
| LAN8710 
| 0/80mA
| FB12
|-
| 3310 
| 30/230mA
| FB13
|-
| VAUX2 
| 0mA
| FB11
|-
| VRTC 
| 0mA
| R86
|}

==pin assignment==
# GND
# POWER
# RX 
# CLK
# TX
# blank
# blank
# CS
# NC

==tps65910 controlled power down==
according to datasheet: http://www.ti.com/lit/ds/symlink/tps65910.pdf

and tested, this will temporally power off CPU (am335x) for 20 milli sec.
  i2cset -f -y 1 0x2d 0x3f 0x71


==common problems==
===rootfs===
 waiting for mmcblk0p2 ... (sd card casing not grounded)